package org.itboys.core.service.mongo.web;

import org.itboys.core.entity.mongo.SundayTrayEwm;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.PageResult;
import org.itboys.param.ParamUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2019/1/7
 * 描述：托盘二维码包
 */
@Service
public class SundayTrayEwmService extends BaseMongoService<SundayTrayEwm> {
    @Resource(name = "mobileDs")
    private MongoDataSource sundayDataSource;

    @Override
    protected MongoDataSource getMongoDataSource() {
        return sundayDataSource;
    }

    @Override
    protected Class<SundayTrayEwm> getEntityClass() {
        return SundayTrayEwm.class;
    }

    public PageResult<SundayTrayEwm> select(HttpServletRequest request) {
        Map<String, Object> param = ParamUtil.packageMongoExactParam(request, "");
        param.put("isDeleted", 0);
        Map<String, String> containsparam = ParamUtil.packageMongoVagueParam(request, "");
        PageResult<SundayTrayEwm> result = super.containpageQuery(request, containsparam, param);
        return result;
    }


}
